package com.zhipu.resetbalance.ui.home.feature;

import android.os.Bundle;

import androidx.databinding.ObservableField;
import androidx.lifecycle.ViewModel;

import com.blankj.utilcode.util.ActivityUtils;
import com.zhipu.resetbalance.ui.home.feature.compute.ComputeActivity;

public class FeatureComputeViewModel extends ViewModel {
    /**
     * 品种
     */
    public ObservableField<Integer> breedObservableField = new ObservableField<>(0);
    /**
     * 品种
     * 切换
     * 品类
     */
    public ObservableField<Boolean> categoryObservableField = new ObservableField<>();

    //名称零
    public ObservableField<String> NameZero = new ObservableField<>();
    //显示零
    public ObservableField<Boolean> revealZero = new ObservableField<>(true);
    //名称一
    public ObservableField<String> NameOne = new ObservableField<>();
    //显示一
    public ObservableField<Boolean> revealOne = new ObservableField<>(true);
    //名称二
    public ObservableField<String> NameTwo = new ObservableField<>();
    //显示二
    public ObservableField<Boolean> revealTwo = new ObservableField<>(true);
    //名称三
    public ObservableField<String> NameThree = new ObservableField<>();
    //显示三
    public ObservableField<Boolean> revealThree = new ObservableField<>(true);
    //名称四
    public ObservableField<String> NameFour = new ObservableField<>();
    //显示四
    public ObservableField<Boolean> revealFour = new ObservableField<>(true);
    //名称五
    public ObservableField<String> NameFive = new ObservableField<>();
    //显示五
    public ObservableField<Boolean> revealFive = new ObservableField<>(true);
    //名称六
    public ObservableField<String> NameSix = new ObservableField<>();
    //显示六
    public ObservableField<Boolean> revealSix = new ObservableField<>(true);
    /**
     * 返回
     */
    public void FunctionalBalance(){
        if(Boolean.TRUE.equals(categoryObservableField.get())){
            categoryObservableField.set(false);
        }else {
            //返回
            ActivityUtils.finishActivity(FeatureComputeActivity.class);
        }

    }

    /**
     * 稻谷
     */
    public void paddy(){
        //品种
        breedObservableField.set(0);
        //
        categoryObservableField.set(true);
        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("谷外糙米");
        revealOne.set(true);
        //名称二
        NameTwo.set("出糙率");
        revealTwo.set(true);
        //名称三
        NameThree.set("整精米");
        revealThree.set(true);
        //名称四
        NameFour.set("黄粒米");
        revealFour.set(true);
        //名称五
        NameFive.set("互混");
        revealFive.set(true);
        //名称六
        NameSix.set("出米率");
        revealSix.set(true);
    }



    /**
     * 小麦
     */
    public void wheat(){
        //品种
        breedObservableField.set(1);
        //
        categoryObservableField.set(true);

        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("不完善");
        revealOne.set(true);
        //名称二
        NameTwo.set("面筋");
        revealTwo.set(true);
        //名称三
        NameThree.set("容重");
        revealThree.set(true);
        //名称四
        NameFour.set("");
        revealFour.set(false);
        //名称五
        NameFive.set("");
        revealFive.set(false);
        //名称六
        NameSix.set("");
        revealSix.set(false);
    }


    /**
     * 玉米
     */
    public void corn(){
        //品种
        breedObservableField.set(2);
        //
        categoryObservableField.set(true);

        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("不完善");
        revealOne.set(true);
        //名称二
        NameTwo.set("容重");
        revealTwo.set(true);
        //名称三
        NameThree.set("");
        revealThree.set(false);
        //名称四
        NameFour.set("");
        revealFour.set(false);
        //名称五
        NameFive.set("");
        revealFive.set(false);
        //名称六
        NameSix.set("");
        revealSix.set(false);
    }

    /**
     * 大米
     */
    public void Rice(){
        //品种
        breedObservableField.set(3);
        //
        categoryObservableField.set(true);

        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("不完善");
        revealOne.set(true);
        //名称二
        NameTwo.set("碎米率");
        revealTwo.set(true);
        //名称三
        NameThree.set("黄粒米");
        revealThree.set(true);
        //名称四
        NameFour.set("互混");
        revealFour.set(true);
        //名称五
        NameFive.set("");
        revealFive.set(false);
        //名称六
        NameSix.set("");
        revealSix.set(false);
    }

    /**
     * 大豆
     */
    public void soybean(){
        //品种
        breedObservableField.set(4);
        //
        categoryObservableField.set(true);
        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("损伤粒率");
        revealOne.set(true);
        //名称二
        NameTwo.set("热损伤粒率");
        revealTwo.set(true);
        //名称三
        NameThree.set("完整粒率");
        revealThree.set(true);
        //名称四
        NameFour.set("");
        revealFour.set(false);
        //名称五
        NameFive.set("");
        revealFive.set(false);
        //名称六
        NameSix.set("");
        revealSix.set(false);
    }


    /**
     * 油菜籽
     */
    public void rapeseed(){
        //品种
        breedObservableField.set(5);
        //
        categoryObservableField.set(true);

        //名称零
        NameZero.set("杂质");
        revealZero.set(true);
        //名称一
        NameOne.set("生芽粒");
        revealOne.set(true);
        //名称二
        NameTwo.set("生霉粒");
        revealTwo.set(true);
        //名称三
        NameThree.set("热损伤粒");
        revealThree.set(true);
        //名称四
        NameFour.set("未熟粒");
        revealFour.set(true);
        //名称五
        NameFive.set("");
        revealFive.set(false);
        //名称六
        NameSix.set("");
        revealSix.set(false);
    }


    /**
     * 方法一
     */
    public void MethodOne(){
        //
        int method = breedObservableField.get();
        //
        Bundle options = new Bundle();
        options.putInt("breed",method);
        ActivityUtils.startActivity(options,ComputeActivity.class);
    }

    /**
     * 方法二
     */
    public void MethodTwo(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

    /**
     * 方法三
     */
    public void MethodThree(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

    /**
     * 方法四
     */
    public void MethodFour(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

    /**
     * 方法五
     */
    public void MethodFive(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

    /**
     * 方法六
     */
    public void MethodSix(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

    /**
     * 方法七
     */
    public void MethodSeven(){
        int method = breedObservableField.get();
        if(method == 0){

        }else if(method == 1) {

        }else if(method == 2) {

        }else if(method == 3) {

        }else if(method == 4) {

        }else if(method == 5) {

        }
    }

}
